﻿using System;
using System.Windows.Forms;

namespace ThreadSafeControls {
    public static class ThreadSafeHelper {
        public static ThreadSafeControl<TControl> AsThreadSafeControl<TControl>(this TControl control) where TControl : Control {
            return new ThreadSafeControl<TControl>(control);
        }
		
        public static ThreadSafeButton AsThreadSafe(this Button button) {
            return new ThreadSafeButton(button);
        }

		public static ThreadSafeCheckBox AsThreadSafe(this CheckBox checkBox) {
			return new ThreadSafeCheckBox(checkBox);
		}
        
        public static ThreadSafeCheckedListBox AsThreadSafe(this CheckedListBox checkedListBox) {
            return new ThreadSafeCheckedListBox(checkedListBox);
        }

        public static ThreadSafeComboBox AsThreadSafe(this ComboBox comboBox) {
            return new ThreadSafeComboBox(comboBox);
        }

        public static ThreadSafeDateTimePicker AsThreadSafe(this DateTimePicker dateTimePicker) {
            return new ThreadSafeDateTimePicker(dateTimePicker);
        }

        public static ThreadSafeListBox AsThreadSafe(this ListBox listBox) {
            return new ThreadSafeListBox(listBox);
        }

        public static ThreadSafeListView AsThreadSafe(this ListView listView) {
            return new ThreadSafeListView(listView);
        }

        internal static ThreadSafeColumnHeader AsThreadSafe(this ColumnHeader columnHeader, ThreadSafeListView listView) {
            return new ThreadSafeColumnHeader(columnHeader, listView);
        }

        internal static ThreadSafeListViewItem AsThreadSafe(this ListViewItem listViewItem, ThreadSafeListView listView) {
            return new ThreadSafeListViewItem(listViewItem, listView);
        }

        internal static ThreadSafeListViewItem.ListViewSubItem AsThreadSafe(this ListViewItem.ListViewSubItem listViewSubItem, ThreadSafeListView listView) {
            return new ThreadSafeListViewItem.ListViewSubItem(listViewSubItem, listView);
        }

        public static ThreadSafeNumericUpDown AsThreadSafe(this NumericUpDown numericUpDown) {
            return new ThreadSafeNumericUpDown(numericUpDown);
        }

        public static ThreadSafeProgressBar AsThreadSafe(this ProgressBar progressBar) {
            return new ThreadSafeProgressBar(progressBar);
        }

        public static ThreadSafeTextBox AsThreadSafe(this TextBox textBox) {
            return new ThreadSafeTextBox(textBox);
        }

        public static ThreadSafeTreeView AsThreadSafe(this TreeView treeView) {
            return new ThreadSafeTreeView(treeView);
        }

        internal static ThreadSafeTreeNode AsThreadSafe(this TreeNode treeNode, ThreadSafeTreeView treeView) {
            return new ThreadSafeTreeNode(treeNode, treeView);
        }

        internal static ThreadSafeTreeNodeCollection AsThreadSafe(this TreeNodeCollection nodes, ThreadSafeTreeView treeView) {
            return new ThreadSafeTreeNodeCollection(nodes, treeView);
        }

		public static ThreadSafeRadioButton AsThreadSafe(this RadioButton radioButton) {
			return new ThreadSafeRadioButton(radioButton);
		}
    }
}
